<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>pvsfread</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="pvsfilter.html" title="pvsfilter" />
    <link rel="next" href="pvsfreeze.html" title="pvsfreeze" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">pvsfread</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="pvsfilter.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="pvsfreeze.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="pvsfread"></a>
      <div class="titlepage"></div>
      <a id="IndexPvsfread" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">pvsfread</span>
        </h2>
        <p>pvsfread — 
      Read a selected channel from a PVOC-EX analysis file.
          </p>
      </div>
      <div class="refsect1">
        <a id="idp138670624"></a>
        <h2>Description</h2>
        <p>
      Create an fsig stream by reading a selected channel from a PVOC-EX analysis file loaded into memory, with frame interpolation. Only format 0 files (amplitude+frequency) are currently supported. The operation of this opcode mirrors that of pvoc, but outputs an fsig instead of a resynthesized signal.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp138672096"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">fsig <span class="command"><strong>pvsfread</strong></span> ktimpt, ifn [, ichan]</pre>
      </div>
      <div class="refsect1">
        <a id="idp138674304"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifn</em></span> -- Name of the analysis file. This must have the .pvx file extension.
    </p>
        <p>
      A multi-channel PVOC-EX file can be generated using the extended <a class="link" href="pvanal.html" title="pvanal"><em class="citetitle">pvanal utility</em></a>.
    </p>
        <p>
      <span class="emphasis"><em>ichan</em></span> -- (optional) The channel to read (counting from 0). Default is 0.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp138678304"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>ktimpt</em></span> -- Time pointer into analysis file, in seconds. See the description of the same parameter of <a class="link" href="pvoc.html" title="pvoc"><em class="citetitle">pvoc</em></a> for usage.
    </p>
        <p>
      Note that analysis files can be very large, especially if multi-channel. Reading such files into memory will very likely incur breaks in the audio during real-time performance. As the file is read only once, and is then available to all other interested opcodes, it can be expedient to arrange for a dedicated instrument to preload all such analysis files at startup.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp138681760"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the pvsfread opcode. It uses the file <a class="ulink" href="examples/pvsfread.csd" target="_top"><em class="citetitle">pvsfread.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp138683616"></a>
          <p class="title">
            <strong>Example 689. Example of the pvsfread opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac  <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o pvsfread.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100 
<span class="ohdr">ksmps</span> <span class="op">=</span> 32 
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1 
<span class="ohdr">nchnls</span> <span class="op">=</span> 2

<span class="oblock">instr</span> 1
<span class="comment">; create a PVOC-EX (*.pvx) file with PVANAL first</span>
idur  <span class="opc">filelen</span>   "kickroll.pvx"		<span class="comment">;find duration of (stereo) analysis file</span>
kpos  <span class="opc">line</span>      0,p3,idur		<span class="comment">;to ensure we process whole file</span>
fsigr <span class="opc">pvsfread</span>  kpos,"kickroll.pvx", 1	<span class="comment">;create fsig from right channel</span>
aout  <span class="opc">pvsynth</span>	fsigr			<span class="comment">;resynthesise it</span>
      <span class="opc">outs</span>	aout, aout

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> 1 0 10
<span class="stamnt">i</span> 1 11 1
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp138687904"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Richard Dobson</td>
          </tr>
          <tr>
            <td>August 2001 </td>
          </tr>
        </table>
        <p>
    </p>
        <p>New in version 4.13</p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="pvsfilter.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="pvsfreeze.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">pvsfilter </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> pvsfreeze</td>
        </tr>
      </table>
    </div>
  </body>
</html>
